
import React, { Component } from 'react'
import RouterView from "../../router/routerView"
import { RouterItem } from "../../router/router-config"
import { NavLink } from "react-router-dom"
interface IProps {
    routes: RouterItem[]
}
export class main extends Component<IProps> {
    render() {
        return (
            <div className="main-page wrap">
                <main>
                    <RouterView routes={this.props.routes} />
                </main>
                <footer>
                    {
                        this.props.routes.map((item:RouterItem)=>{
                        return item.tit? <NavLink key={item.path} to={item.path}>{item.tit}</NavLink> : null
                        })
                    }
                </footer>
            </div>
        )
    }
}

export default main
